Skip to content

fix(cli): use emitted Worker entry for Cloudflare deploys - #923

Merged
cpojer merged 1 commit into
mainfrom
fix/cloudflare-worker-entry
Nov 26, 2026
Merged

cpojer merged 1 commit into
mainfrom
fix/cloudflare-worker-entry

Conversation

@Dunqing

@Dunqing Dunqing commented Nov 26, 2026

Copy link
Copy Markdown
Member

Static Cloudflare deploys fail when package.json omits "type" or sets "type": "commonjs". Vite emits index.mjs for the Worker in those projects, but Void writes index.js to the generated wrangler.json. Deploy preparation then fails because that file doesn't exist.

Use the entry chunk's filename from Vite's build result as main. This preserves Vite's naming in both CommonJS and ES module projects.

The regression test covers implicit CommonJS, explicit CommonJS, and ES modules. Both CommonJS cases fail without the fix. vp run test:all passed.

Fixes #922.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-cloudflare-worker-entry-void-cloud.voidzero-docs.workers.dev (commit 2fc7961)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4973f944-void-cloud.voidzero-docs.workers.dev 2fc7961 2026-11-26T05:01:53.669Z Visit the dashboard ↗

@cpojer cpojer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cpojer
cpojer merged commit 383ee45 into main Nov 26, 2026
22 checks passed
@cpojer
cpojer deleted the fix/cloudflare-worker-entry branch November 26, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Static Cloudflare deploy fails with missing index.js in CommonJS projects

2 participants